package xkp.lesson1;

import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;

public class MyFrame extends JFrame {

    public MyFrame() throws HeadlessException {
        this.setTitle("MyFrame");
        //this.setSize(400,300);
        this.setBounds(400,300,400,300);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container c = this.getContentPane();
        JLabel jLabel = new JLabel("hello");
        c.add(jLabel,BorderLayout.NORTH);
        JButton jButton = new JButton("按钮");
        c.add(jButton,BorderLayout.WEST);
        JButton jButton2 = new JButton("按钮2");
        c.add(jButton2,BorderLayout.EAST);
       /* JPanel jPanel = new JPanel();
        //jPanel.setBackground(new Color(123));
        jPanel.setBackground(Color.GRAY);
        this.add(jPanel);*/
        //this.setBackground(new Color(123));
        JLabel jLabel1 = new JLabel("中");
        this.add(jLabel1, BorderLayout.CENTER);
        JTextField jTextField = new JTextField();
        this.add(jTextField,BorderLayout.SOUTH);
        this.setVisible(true);
    }


}
